<template>
  <div class="header">
    <slot> </slot> <span v-show="headerTitle==='开始做题'&&errorCode===0">({{questionPosition}}/{{data.length}})</span>
  </div>
</template>
<script>
import { computed } from 'vue'
import { useStore } from 'vuex'
export default {
  name: 'headerpage',
  setup() {
    const store = useStore()
    return {
      headerTitle: computed(() => store.state.headerTitle),
      data: computed(() => store.state.data),
      questionPosition: computed(() => store.state.questionPosition),
      errorCode: computed(() => store.state.errorCode)
    }
  }
}
</script>
<style lang="less" scoped>
.header {
  height: 46px;
  line-height: 46px;
  color: #ffffff;
  background-color: #00afff;
  text-align: center;
  font-size: 18px;
}
</style>
